
var MaskWindow = new Class({

    Implements: [Options, Events],
    options: {
        'containerId': 'container',
        'contentId': 'content',
        'event': 'mousemove'
    },

    initialize: function(_options) {
        this.setOptions(_options);

        var c = $(this.options.containerId);
        t = $(this.options.contentId);

        // Set Styles
        c.setStyles({
            'overflow': 'auto',
            'overflow-y': 'hidden',
            'overflow-x': 'hidden'
        });
        t.setStyle('position', 'relative');

        // Add Event
        c.addEvent(this.options.event, function(e) {
            var size1, size2, p;

            s1 = c.getSize();
            s2 = t.getSize();

            if (s1.x >= s2.x && s1.y >= s2.y) {
                t.setStyle('top', 0);
                t.setStyle('left', 0);
                return false;
            }

            p = c.getPosition();

            t.setPosition({
                x: (1 - s2.x / s1.x) * (e.page.x - p.x),
                y: (1 - s2.y / s1.y) * (e.page.y - p.y)
            });

        });
    }
});